<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">


<h:head>
	<title>Aggiungi Camere</title>
</h:head>
<h:body>
	<ui:composition template="../template.xhtml">
		<ui:define name="menu">


			<h:form prependId="false">
				<p:menu id="left">

					<p:submenu label="Area Personale">
						<p:menuitem value="Home" outcome="index" icon="ui-icon-home" />
						<p:menuitem value="Cronologia Viaggi" outcome="storicoViaggi"
							icon="ui-icon-star" />
						<p:menuitem value="Le Mie GiftList" outcome="statoGift"
							icon="ui-icon-star" />
						<p:menuitem value="Invito Viaggi" outcome="showInviti"
							icon="ui-icon-star" />
						<p:menuitem value="Invito Giftlist" outcome="showInvitiGift"
							icon="ui-icon-star" />
						<p:menuitem value="Logout" action="#{logoutBean.logout()}"
							icon="ui-icon-close" />
					</p:submenu>
				</p:menu>
			</h:form>
		</ui:define>
		<ui:define name="content">
			<h1>Hello #{userBean.name}</h1>
			<h:form>
				<p:commandButton action="#{logoutBean.logout}" value="Logout" />


				<p:panel header="Compila Pacchetto">
					<h:panelGrid columns="3" id="regGrid">
						<h:outputLabel for="minmax" value="Numero Partecipanti: " />
						<p:spinner id="minmax" value="#{compilaBean.numPers}" min="1"
							max="16" />
						<h:outputLabel />
						<h:outputText value="Camere Singole: " />
						<p:selectOneRadio id="options1" value="#{compilaBean.n1}">
							<f:selectItem itemLabel="1" itemValue="1" />
							<f:selectItem itemLabel="2" itemValue="2" />
							<f:selectItem itemLabel="3" itemValue="3" />
							<f:selectItem itemLabel="4" itemValue="4" />
						</p:selectOneRadio>
						<h:outputText />
						<h:outputText value="Camere Doppie: " />
						<p:selectOneRadio id="options2" value="#{compilaBean.n2}">
							<f:selectItem itemLabel="1" itemValue="1" />
							<f:selectItem itemLabel="2" itemValue="2" />
							<f:selectItem itemLabel="3" itemValue="3" />
							<f:selectItem itemLabel="4" itemValue="4" />
						</p:selectOneRadio>
						<h:outputText />
						<h:outputText value="Camere Triple: " />
						<p:selectOneRadio id="options3" value="#{compilaBean.n3}">
							<f:selectItem itemLabel="1" itemValue="1" />
							<f:selectItem itemLabel="2" itemValue="2" />
							<f:selectItem itemLabel="3" itemValue="3" />
							<f:selectItem itemLabel="4" itemValue="4" />
						</p:selectOneRadio>
						<h:outputText />
						<h:outputText />
						<h:outputText />


						<h:outputText />
						<p:commandButton value="Acquista" icon="ui-icon-search"
							update="regGrid" actionListener="#{compilaBean.calcola()}"
							oncomplete="PF('confermaDialog').show()" />
						<p:commandButton value="Modifica Pacchetto" icon="ui-icon-search"
							update="regGrid" actionListener="#{compilaBean.modifica()}" />
						<p:commandButton value="AcquistaSuggerisci" icon="ui-icon-search"
							update="regGrid" actionListener="#{compilaBean.invita()}" />
						<p:commandButton value="ConfermaEGift" icon="ui-icon-search"
							update="regGrid" actionListener="#{compilaBean.gift()}" />
						<p:dialog header="conferma" widgetVar="confermaDialog" width="450"
							showEffect="explode" hideEffect="explode">
							<h:outputLabel
								value="SEI SICURO DI VOLER ACQUISTARE? costo tot: #{compilaBean.costo} euro" />
							<p:commandButton value="Acquista" update="regGrid"
								actionListener="#{compilaBean.acqusita()}" />

						</p:dialog>


					</h:panelGrid>
				</p:panel>

			</h:form>
		</ui:define>

	</ui:composition>
</h:body>
</html>